package com.petShop.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.petShop.mappers.GoodMapper;
import com.petShop.models.Good;

@Repository
public class GoodDao {
	@Autowired
	private GoodMapper GoodMapper;
	//宠物狗
	public void insertPet(Good pet){
		GoodMapper.insertPet(pet);
	}
	
	public List<Good> selectPets(){
		return GoodMapper.selectPets();	
	}
	
	public List<Good> getPetsbyPage(int start){
		return GoodMapper.getPetsbyPage(start);
	}
	
	public List<Good> selectColor(String color){
		return GoodMapper.selectColor(color);
	}
	
	
	public List<Good> searchGoods(Good good){
		return GoodMapper.searchGoods(good);	
	}
	
	public List<Good> searchBylowPrice(Good good){
		return GoodMapper.searchBylowPrice(good);	
	}
	
	public List<Good> searchByhighPrice(Good good){
		return GoodMapper.searchByhighPrice(good);	
	}

	public List<Good> searchGoodsByName(Good good){
		return GoodMapper.searchGoodsByName(good);	
	}
	
	public List<Good> searchByNameAndLowPrice(Good good){
		return GoodMapper.searchByNameAndLowPrice(good);	
	}
	
	public List<Good> searchByNameAndHighPrice(Good good){
		return GoodMapper.searchByNameAndHighPrice(good);	
	}
	
	public void updatePet(Good good){
		GoodMapper.updatePet(good);
	}
	public void updatePet2(Good good){
		GoodMapper.updatePet2(good);
	}
	//周边
	public void insertPetGood(Good petGood){
		GoodMapper.insertPetGood(petGood);
	}
	
	public List<Good> selectPetGoods(){
		return GoodMapper.selectPetGoods();	
	}
	
	public List<Good> searchPetGoods(Good good){
		return GoodMapper.searchPetGoods(good);
	}
	
	public List<Good> searchPetGoodsBylowPrice(Good good){
		return GoodMapper.searchPetGoodsBylowPrice(good);	
	}
	
	public List<Good> searchPetGoodsByhighPrice(Good good){
		return GoodMapper.searchPetGoodsByhighPrice(good);	
	}

	public List<Good> searchPetGoodsByName(Good good){
		return GoodMapper.searchPetGoodsByName(good);	
	}
	
	public List<Good> searchPetGoodsByNameAndLowPrice(Good good){
		return GoodMapper.searchPetGoodsByNameAndLowPrice(good);	
	}
	
	public List<Good> searchPetGoodsByNameAndHighPrice(Good good){
		return GoodMapper.searchPetGoodsByNameAndHighPrice(good);	
	}
	
	public void updatePetGoods(Good good){
		GoodMapper.updatePetGoods(good);
	}
	public void updatePetGoods2(Good good){
		GoodMapper.updatePetGoods2(good);
	}
	
	//宠物狗和周边
	public Good selectGood(int goodId){
		return GoodMapper.selectGood(goodId);
	}
	
	public List<Good> selectkinds(int kindsId){
		return GoodMapper.selectkinds(kindsId);
	}
	
	public void deleteGood(int id){
		GoodMapper.deleteGood(id);
	}
	public void addSales(Good good){
		GoodMapper.addSales(good);
	}
}
